extends ../../components/layout
append style
  +css('demo/demo.css')
block title
  title button
block content
  header.demos-header
    h1.demos-title Toast
  .demos-content
    .btn.test1 单行文本
    .btn.test2 多行文本
    .btn.test3 文本+图标
    .btn.test4 duration
    .btn.test5 callback
append script
  script.
    require(['common'], function () {
      $.toast();
      $(".test1").on("click", function () {
        $.toast({
          text: '3s后渐渐消失'
        });
      })
      $(".test2").on("click", function () {
        $.toast({
          text: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet cum deserunt doloribus, laboriosam nulla obcaecati perspiciatis porro suscipit! Accusantium asperiores delectus explicabo hic labore magni natus non odio unde voluptate.'
        });
      })
      $(".test3").on("click", function () {
        $.toast({
          icon: '#icon-question',
          text: '3s后渐渐消失'
        });
      })
      $(".test4").on("click", function () {
        $.toast({
          text: '1s后渐渐消失',
          duration: 1000
        });
      })
      $(".test5").on("click", function () {
        $.toast({
          text: '消失后执行回调',
          callback: function () {
            $.toast({text: '回调'})
          }
        });
      })
    })